#ifndef MUSICPLAYER_H
#define MUSICPLAYER_H

#include <QWidget>
#include <QHeaderView>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QStandardItemModel>
#include <QTableView>
#include <QList>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QPainter>
#include <QPixmap>
#include <QLabel>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QUrl>
#include <QWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QVideoWidget>
#include <QTimer>


namespace Ui {
class musicplayer;
}

class musicplayer : public QWidget
{
    Q_OBJECT

public:
     QTimer * m_time_1;
    explicit musicplayer(QWidget *parent = nullptr);
    ~musicplayer();
public slots:
    void setBackgroundImage(QString path);
     void onResized();
private slots:

    void replyFinished(QNetworkReply *reply);
    void parseJson(QByteArray byteArray);
    void parseJson_2(QByteArray byteArray);
    void on_pushButton_clicked();
    void on_tableView_doubleClicked(const QModelIndex &index);
    void downloadImage(const QString &url);
    void replyFinished_2(QNetworkReply *reply);

    void on_pushButton_2_clicked();
    void positionChangedSlot(qint64 position);



public:
    void mp4is();
//    QTimer m_time_1;
//    QPixmap m_Poxmap[500];
    QStringList lines;
    QMediaPlayer *player ;
    bool words_flag;
    QPixmap muspix;
    QStandardItemModel * pModel;

    QStandardItem *itemWithImage;
    QPixmap backgroundImage;

    QJsonArray songsArry;

//    QMediaPlayer * mp3player = new QMediaPlayer;
//    QVideoWidget * mp3videoWidget = new QVideoWidget(this);
    QMediaPlaylist *playlist;
    QList<int> musicIDList;
    QNetworkAccessManager *manager;
    QNetworkAccessManager *manager_2;
    Ui::musicplayer *ui;
};

#endif // MUSICPLAYER_H
